package com.sondon.dev_info.serviceImpl;

import java.util.List;

import javax.annotation.Resource;
import javax.transaction.Transactional;

import org.springframework.stereotype.Service;

import com.sondon.dev_info.dao.DaoTemplate;
import com.sondon.dev_info.service.TemplateManager;

@Service("templateManager")
@Transactional
public class TemplateManagerImpl<T> implements TemplateManager<T> {
	
	@Resource(name="DaoTemplateImpl")
	private DaoTemplate<T> daoTemplate;

	@Override
	public T get(String id,Class<T> t) {
		return 	daoTemplate.get(id, t);
	}
	
	@Override
	public T get_by_hql(String hql) {
		return 	daoTemplate.get_by_hql(hql);
	}

	@Override
	public void add(T t) {
		daoTemplate.add(t);
	}

	@Override
	public boolean update(T t) {
		return daoTemplate.update(t);
	}

	@Override
	public List<T> getAll(Class<T> t) {
		return daoTemplate.getAll(t);
	}

	@Override
	public boolean del(String id, Class<T> t) {
		return daoTemplate.del(id, t);
	}

	@Override
	public boolean save_update(T t) {
		
		return daoTemplate.save_update(t);
	}

}
